-
Notifications
You must be signed in to change notification settings - Fork 4k
Az.StorageSync | Added TenantId of ARC Server and checked with StorageSyncService tenant to prevent unsupported configuration #28355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Azure Storage Sync server registration functionality to validate tenant alignment between ARC servers and Storage Sync Services, preventing unsupported cross-tenant configurations.
- Extracts tenant ID from server managed identity tokens and compares with Storage Sync Service tenant
- Refactors server application identity handling to return both application ID and tenant ID asynchronously
- Adds validation to prevent cross-tenant server registrations with appropriate error messaging
Reviewed Changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
SetRegisteredServerCommand.cs | Updated to use new async method for getting server application identity |
RegisterServerCommand.cs | Added tenant ID validation and passes tenant to registration client |
StorageSyncResources.resx | Added error message resource for missing Azure context tenant ID |
ServerManagedIdentityTokenHelper.cs | Added method to extract tenant ID from tokens and updated documentation |
ServerManagedIdentityProvider.cs | Refactored to return ServerApplicationIdentity with both app ID and tenant ID |
ServerApplicationIdentity.cs | New class to encapsulate server application identity information |
ISyncServerRegistration.cs | Updated interface to accept tenant ID parameter |
IServerManagedIdentityProvider.cs | Updated interface for async operation returning ServerApplicationIdentity |
SyncServerRegistrationClientBase.cs | Added tenant validation logic in registration process |
SyncServerRegistrationClient.cs | Updated to use new async identity retrieval method |
MockSyncServerRegistrationClientBase.cs | Updated mock implementation for new interface |
MockSyncServerRegistrationClient.cs | Updated mock to return ServerApplicationIdentity objects |
MockServerManagedIdentityProvider.cs | Updated mock provider for new async interface |
Files not reviewed (1)
- src/StorageSync/StorageSync/Properties/StorageSyncResources.Designer.cs: Language not supported
src/StorageSync/StorageSync/Properties/StorageSyncResources.resx
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityTokenHelper.cs
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/Clients/SyncServerRegistrationClientBase.cs
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync.Test/Common/MockSyncServerRegistrationClientBase.cs
Show resolved
Hide resolved
src/StorageSync/StorageSync.Test/Common/MockSyncServerRegistrationClient.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…gedIdentityTokenHelper.cs Co-authored-by: Copilot <[email protected]>
…tionClientBase.cs Co-authored-by: Copilot <[email protected]>
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityTokenHelper.cs
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/Clients/SyncServerRegistrationClientBase.cs
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/Clients/SyncServerRegistrationClientBase.cs
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/Interfaces/ISyncServerRegistration.cs
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityProvider.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
/azp run |
Commenter does not have sufficient privileges for PR 28355 in repo Azure/azure-powershell |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.